package com.yunxi.poc.starbucks.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunxi.poc.starbucks.entity.ReportEntity;
import com.yunxi.poc.starbucks.mapper.ReportMapper;
import com.yunxi.poc.starbucks.service.IReportService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mingzhi
 */
@Service
public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> implements IReportService {

    @Override
    public List<ReportEntity> list(ReportEntity record) {
        QueryWrapper<ReportEntity> wrapper = new QueryWrapper<>();
        wrapper.ge("sale_datetime", record.getQueryStartTime());
        wrapper.le("sale_datetime", record.getQueryEndTime());
        wrapper.eq("store_id", record.getStoreId());
        return this.getBaseMapper().selectList(wrapper);
    }

}
